<?php

namespace App\Repositories\Api;

use App\Repositories\AreaRepository;
use App\Repositories\Api\MemberRepository;

use App\Models\Member;
use Exception;

class WechatMenusRepository
{

    public function getMemberCategoryForMember($unset_cids = "")
    {
        $model_set_fields = array(
            ['title' => "基本信息", "id" => 1, 'fields' => array('birthday', 'height', 'marital_history', 'make_friend_type')],//'ismyself',
            ['title' => "个人相册", "id" => 6, 'type' => "picture"],
            ['title' => "联系方式", "id" => 3, 'fields' => array('mobile', 'weixin', 'weixin_qrcode_pic')],
            ['title' => "认证", "id" => 14, 'fields' => array('idcard_status', 'status')],
//            ['title' => "坐标", "id" => 2, 'fields' => array('location', 'work_or_study_place', 'residence', 'hometown', 'country', 'last_login_ip_title')],
//            ['title' => "学校", "id" => 4, 'fields' => array('undergraduate', 'master_college', 'doctor_college', 'education', 'profession', 'current_status')],
//            ['title' => "工作", "id" => 5, 'fields' => array('work_org', 'work_status', 'occupation', 'work_type', 'year_salary')],
            ['title' => "关于我", "id" => 9, 'fields' => array('about_me', 'hobby')],
            ['title' => "家庭情况", "id" => 8, 'fields' => array('famliy_condition')],
            ['title' => "心仪的Ta", "id" => 7, 'fields' => array('about_you')],
        );

        $unset_cids = array_filter(explode(",", $unset_cids));
        foreach ($model_set_fields as $k => $v) {
            if (in_array($v['id'], $unset_cids)) {
                unset($model_set_fields[$k]);
                continue;
            }
        }

        return $model_set_fields;
    }

    public function getMemberCategoryForProfile()
    {
        $model_set_fields = array(
            ['title' => "基本信息", "id" => 1, 'fields' => array('birthday', 'height', 'marital_history', 'make_friend_type', 'current_status')],
            ['title' => "个人相册", "id" => 6, 'type' => "picture"],
            ['title' => "联系方式", "id" => 3, 'fields' => array('mobile', 'weixin', 'weixin_qrcode_pic')],
            ['title' => "认证", "id" => 14, 'fields' => array('idcard_status', 'status')],
//            ['title' => "坐标", "id" => 2, 'fields' => array('location', 'work_or_study_place', 'residence', 'hometown', 'country')],
//            ['title' => "学校", "id" => 4, 'fields' => array('undergraduate', 'master_college', 'doctor_college', 'education', 'profession', 'current_status')],
//            ['title' => "工作", "id" => 5, 'fields' => array('work_org', 'work_status', 'occupation', 'work_type', 'year_salary')],
            ['title' => "关于我", "id" => 9, 'fields' => array('about_me', 'hobby')],
            ['title' => "家庭情况", "id" => 8, 'fields' => array('famliy_condition')],
            ['title' => "心仪的Ta", "id" => 7, 'fields' => array('about_you')],
        );

        return $model_set_fields;
    }

}

